﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DomainDriver.DomainModeling.DataProviders;
using DomainDriver.DomainModeling.DomainObjects;
using DomainDriver.DomainModeling.Queries;

namespace DomainDriver.DomainModeling.StorageManagers
{
    public interface IStorageManager<KEY, KEYED_DOMAIN_OBJECT>
        where KEYED_DOMAIN_OBJECT : IKeyedDomainObject<KEY, KEYED_DOMAIN_OBJECT>
    {
        IDataProvider DataProvider { get; }
        int Count();
        bool Exists(KEY key);
        bool Exists(ICollection<KEY> keys);
        ICollection<KEY> FindKeys();
        ICollection<KEY> FindKeys(IQuery<KEYED_DOMAIN_OBJECT> query);
        ICollection<KEYED_DOMAIN_OBJECT> Read();
        ICollection<KEYED_DOMAIN_OBJECT> Read(IQuery<KEYED_DOMAIN_OBJECT> query);
        ICollection<KEYED_DOMAIN_OBJECT> Read(ICollection<KEY> keys);
        KEYED_DOMAIN_OBJECT Read(KEY key);
        void Add(KEYED_DOMAIN_OBJECT domainObject);
        void Remove(KEYED_DOMAIN_OBJECT domainObject);
        void Update(KEYED_DOMAIN_OBJECT domainObject);
    }
}